import { BasicColumn } from '/@/components/Table';
import { FormSchema } from '/@/components/Form/index';
const typeList = [
  {
    label: '整型',
    value: 0,
  },
  {
    label: '长整型',
    value: 1,
  },
  {
    label: '单精度型',
    value: 2,
  },
  {
    label: '双精度型',
    value: 3,
  },
  {
    label: '布尔型',
    value: 4,
  },
  {
    label: '字符串型',
    value: 5,
  },
  {
    label: '时间型',
    value: 6,
  },
  {
    label: '结果集型',
    value: 7,
  },
  {
    label: '二进制字符串型',
    value: 8,
  },
];
export const propColumns: BasicColumn[] = [
  {
    title: '属性名称',
    dataIndex: 'propName',
  },
  {
    title: '初始值',
    dataIndex: 'initValue',
  },
  {
    title: '数据类型',
    dataIndex: 'propDataType',
    customRender: ({ record }) => {
      return typeList[record.propDataType]?.label;
    },
  },
  {
    title: '最小值',
    dataIndex: 'lowValue',
  },
  {
    title: '最大值',
    dataIndex: 'upValue',
  },

  {
    title: '标识',
    dataIndex: 'propId',
  },
];

export const propSchemas: FormSchema[] = [
  {
    field: 'propName',
    component: 'Input',
    label: `属性名称`,
    rules: [{ required: true }],
    colProps: {
      span: 12,
    },
  },
  {
    field: 'propDataType',
    component: 'Select',
    label: `数据类型`,
    colProps: {
      span: 12,
    },
    componentProps: {
      options: typeList,
    },
  },
  {
    field: 'initValue',
    component: 'Input',
    label: `初始值`,

    colProps: {
      span: 12,
    },
  },
  {
    field: 'lowValue',
    component: 'Input',
    label: `最小值`,

    colProps: {
      span: 12,
    },
  },
  {
    field: 'upValue',
    component: 'Input',
    label: `最大值`,
    colProps: {
      span: 12,
    },
  },
  {
    field: 'propNum',
    component: 'InputNumber',
    label: `个数`,
    colProps: {
      span: 12,
    },
  },
];

export const field = {
  initValue: '0',
  length: 0,
  lowValue: '',
  openCacuContent: '',
  propDataType: 0,
  propId: 2,
  propName: '拟稿人重复标识',
  propNum: 0,
  sendCacuContent: '',
  tableFieldId: 0,
  tableId: -1,
  upValue: '',
};
